/*
* Copyright (C) 2020 ~ 2023 chaigec All Rights Reserved.
*
* Author:     chaigec <chaigec@163.com>
* Maintainer: chaigec <chaigec@163.com>

 * Use of this source code is governed by MIT license that can be found in the
 * LICENSE file in the root of the source tree. All contributing project authors
 * may be found in the AUTHORS file in the root of the source tree.
*/

#include "MkHttpRequest.h"
#include "MkHttpResponse.h"





int main(int argc, char ** argv)
{
    MkString Req1 = "";
    Req1 += "GET /api/v1/test?token=xx&&a=1&&b=2 HTTP/1.1\r\n";
    Req1 += "Host: 192.168.1.117:8090\r\n";
    Req1 += "Connection: keep-alive\r\n";
    Req1 += "Cache-Control: max-age=0\r\n";
    Req1 += "Upgrade-Insecure-Requests: 1\r\n";
    Req1 += "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36\r\n";
    Req1 += "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9\r\n";
    Req1 += "Accept-Encoding: gzip, deflate\r\n";
    Req1 += "Accept-Language: zh-CN,zh;q=0.9\r\n";

    MkString Req2 = "";
    Req2 += "GET /api/v1/test?token=xx&&a=1&&b=2 HTTP/1.1\r\n";
    Req2 += "Host: 192.168.1.117:8090\r\n";
    Req2 += "Connection: keep-alive\r\n";
    Req2 += "Cache-Control: max-age=0\r\n";
    Req2 += "Authorization: Basic YWRtaW46YWRtaW4=\r\n";
    Req2 += "Upgrade-Insecure-Requests: 1\r\n";
    Req2 += "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36\r\n";
    Req2 += "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9\r\n";
    Req2 += "Accept-Encoding: gzip, deflate\r\n";
    Req2 += "Accept-Language: zh-CN,zh;q=0.9\r\n";

    MkString Req3 = "";
    Req3 += "PUT /api/v1/sip-info HTTP/1.1\r\n";
    Req3 += "Authorization: Basic YWRtaW46YWRtaW4=\r\n";
    Req3 += "Content-Type: text/plain\r\n";
    Req3 += "User-Agent: PostmanRuntime/7.29.2\r\n";
    Req3 += "Accept: */*\r\n";
    Req3 += "Postman-Token: d3c7da15-4466-488e-a865-903a956b211c\r\n";
    Req3 += "Host: 192.168.1.117:8090\r\n";
    Req3 += "Accept-Encoding: gzip, deflate, br\r\n";
    Req3 += "Connection: keep-alive\r\n";
    Req3 += "Content-Length: 158\r\n";
    Req3 += "\r\n";
    Req3 += "{\r\n";
    Req3 += "    \"ip\" : \"0.0.0.0\",\r\n";
    Req3 += "    \"port\" : 5060,\r\n";
    Req3 += "    \"realm\" : \"3402000000\",\r\n";
    Req3 += "    \"sipId\" : \"34020000002000000001\",\r\n";
    Req3 += "    \"waitTime\" : 2000,\r\n";
    Req3 += "    \"limitType\" : \"None\"\r\n";
    Req3 += "}\r\n";
    Req3 += "\r\n";

    MkString Res1 = "";
    Res1 += "HTTP/1.1 200 OK\r\n";
    Res1 += "Date: Sun, 04 Sep 2023 08:51:20 GMT\r\n";
    Res1 += "Content-Length: 16\r\n";
    Res1 += "Content-Type: application/json;charset=utf-8\r\n";
    Res1 += "\r\n";
    Res1 += "{\r\n";
    Res1 += "	\"code\" : 0\r\n";
    Res1 += "}\r\n";
    Res1 += "\r\n";

    //CMkHttpRequest* pReq = CMkHttpRequest::CreateNew(Req1);
    //MkDelete(pReq);
    //pReq = CMkHttpRequest::CreateNew(Req2);
    //MkDelete(pReq);
    //pReq = CMkHttpRequest::CreateNew(Req3);
    //int BodySize = pReq->GetBody().size();
    //MkDelete(pReq);

    //CMkHttpResponse *pRes = CMkHttpResponse::CreateNew(Res1);
    //MkDelete(pRes);
    return 0;
}